﻿<%@ Page Language="C#"  MasterPageFile="~/admin/MasterPageAdmin.master"  AutoEventWireup="true" CodeFile="ManageAdvertise.aspx.cs" Inherits="admin_ManageAdvertise" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="contentContainer page_un" style="padding-top:20px;">
                    <div class="contentPadd un">
                        <div class="prods_content prods_table">
<form runat=server id="ManageAd">
<asp:GridView ID="grdAdvertise" runat="server" AllowPaging="True" 
			AutoGenerateColumns="False" DataKeyNames="Adv_ID" Width="100%" 
    BorderStyle="Solid" BorderWidth="3px"
			CellPadding="3" OnRowDataBound="grdAdvertise_RowDataBound" 
			OnPageIndexChanging="grdAdvertise_PageIndexChanging" 
    OnRowCommand="grdAdvertise_RowCommand" BorderColor="#CCCCCC" SelectedIndex="0">
			<Columns>        
				 <asp:TemplateField HeaderText="Tùy chọn">
					 <HeaderStyle BackColor="#D4D4D4" ForeColor="#888888" />
					<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
					<ItemTemplate>
						<asp:CheckBox ID="chkCheck" runat="server" />                               
					</ItemTemplate>
				</asp:TemplateField> 
				<asp:TemplateField HeaderText="ID">            
					<HeaderStyle BackColor="#D4D4D4" ForeColor="#888888" />
					<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
					<ItemTemplate>
						<asp:Label ID="Adv_ID" runat="Server" Text='<%#Eval("Adv_ID") %>' ></asp:Label>
					</ItemTemplate>
				</asp:TemplateField>
				 <asp:TemplateField HeaderText="Website">            
					 <HeaderStyle BackColor="#D4D4D4" ForeColor="#888888" />
					<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
					<ItemTemplate>
					<a href='<%# "EditAdvertise.aspx?Advertise_ID=" + Eval("Adv_ID") %>'>
						<asp:Label ID="Advertise_Adv_Link" runat="Server" Text='<%#Eval("Adv_Link") %>' ></asp:Label>
				    </a>
					</ItemTemplate>
				</asp:TemplateField>  
				 <asp:TemplateField HeaderText="Hình ">            
					 <HeaderStyle BackColor="#D4D4D4" ForeColor="#888888" />
					<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
					<ItemTemplate>                                   
                    <img src='../Images/Adv/<%#Eval("Adv_Image") %>' height="100" width="90" />                
					</ItemTemplate>
				</asp:TemplateField>     
					
				<asp:TemplateField  HeaderText="Hiển thị">
					<ControlStyle Height="16px" Width="16px" />
					<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" 
                        BackColor="#D4D4D4" ForeColor="#888888" />
					<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
					<ItemTemplate>
						<asp:ImageButton ID="btnActive" CommandArgument='<%# Eval("Adv_ID") %>' CommandName="active_Advertise"  ImageUrl="Images/check.gif" runat="server" /></a>                            
					</ItemTemplate>
				</asp:TemplateField>     
				
				<asp:TemplateField >
					<ControlStyle Height="16px" Width="16px" />
                    <HeaderStyle BackColor="#D4D4D4" ForeColor="#888888" />
					<ItemStyle HorizontalAlign="Center" 
                        VerticalAlign="Middle" Wrap="True" />
					<HeaderTemplate>
					<asp:Label ID="Label3" runat="server" Text="Chức năng" ></asp:Label>                   
					</HeaderTemplate>
					<ItemTemplate>                                
						<asp:HyperLink ID="lnkEdit" runat="server" Font-Bold="true" NavigateUrl='<%# "EditAdvertise.aspx?Advertise_ID=" + Eval("Adv_ID") %>'>
							<asp:Image ID="ImageEdit" ToolTip="Sửa thông tin" runat="server" ImageUrl="~/images/edit.PNG" />
						</asp:HyperLink>                                
						 <asp:ImageButton ID="btnDelete" CommandArgument='<%# Eval("Adv_ID") %>' CommandName="delete_Advertise"  ImageUrl="~/images/drop-no.gif" runat="server"  
						 OnClientClick = "javascript:return confirm('Bạn có chắc chắn không ?');"/>                                              
						 
					</ItemTemplate>
					<ItemStyle Wrap="False" />
				</asp:TemplateField>
			</Columns>      
			<PagerSettings FirstPageText="Trang đầu" LastPageText="Trang cuối" NextPageText="&gt;&gt;"
			  PageButtonCount="5" PreviousPageText="&lt;&lt;" />     
			<FooterStyle Font-Bold="True" />
			<selectedrowstyle font-bold="True" />
			<headerstyle font-bold="True" />
			<alternatingrowstyle backcolor="White" />
		</asp:GridView>
		</form>
		</div>
		</div>
		</div>
		</asp:Content>